package com.baosight.sczx.common.zm.cInterface.cl;

import java.util.HashMap;
import java.util.Map;

import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.dao.Dao;

/**
 * 安全巡检点接口
 * <p>Title: StandardEquipment.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张志芳
 * @version 1.0
 * <pre>Histroy:
 *          2011-4-12 下午05:08:05  张志芳  Create
 *</pre>
 */
public class ItemAssciation {		

	private static Dao dao = (Dao)SpringApplicationContext.getBean("dao");
	
	/**
	 * 删除巡检点下挂的安全检查项目
	 * <p>Function: deleteItem</p>
	 * <p>Description: </p>
	 * <p>return value:Boolean</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-6-30     高强
	 * </p>
	 *
	 */
	public static Boolean deleteItem(EiInfo inInfo)
	{
		Map<String, String> _args = new HashMap<String, String>();
		for(int i=0;i<inInfo.getBlock(EiConstant.resultBlock).getRowCount();i++)
		{
			_args.put("fdSurveypointId", inInfo.getBlock(EiConstant.resultBlock).getCell(i, "fdSurveypointId").toString());
		
			try {
				dao.delete("ZMCLItemAssociation.deleteFromSurveypointId", _args);
			}
			catch(Exception e) {
				return false;
			}
		}
		return true;
	}
}